function EnterDefeat()
    local shade = AddShade(g_Data.scene.layer);
    
    local scene = LoadJson("defeat.json");
    scene:setPosition(cc.p(g_Data.scene.width/2-scene.layer:getContentSize().width/2
        , g_Data.scene.height/2-scene.layer:getContentSize().height/2));

    local function okCallBack(sender, eventType)
        if eventType == ccui.TouchEventType.ended then
            PopScene();
            AudioEngine.playMusic(EXCEL.sound.world.value, true)
            FlushSitem();
        end
    end
    local button = scene.layer:getChildByName("ok")
    button:addTouchEventListener(okCallBack)

    local function retryCallBack(sender, eventType)
        if eventType == ccui.TouchEventType.ended then
           PopScene();
           EnterGate(g_Data.gateId);
        end
    end
    local button = scene.layer:getChildByName("retry")
    button:addTouchEventListener(retryCallBack)
    
    g_Data.scene.layer:addChild(scene);
end

